<?php

/**
 * SfAnimedbUsuario form base class.
 *
 * @package    form
 * @subpackage sf_animedb_usuario
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
 */
class BaseSfAnimedbUsuarioForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'nombre'              => new sfWidgetFormInput(),
      'pass_md5'            => new sfWidgetFormInput(),
      'email'               => new sfWidgetFormInput(),
      'mostrar_correo'      => new sfWidgetFormInput(),
      'codigo_verificacion' => new sfWidgetFormInput(),
      'privilegios'         => new sfWidgetFormInput(),
      'ciudad'              => new sfWidgetFormInput(),
      'pais'                => new sfWidgetFormInput(),
      'permite_intercambio' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorPropelChoice(array('model' => 'SfAnimedbUsuario', 'column' => 'id', 'required' => false)),
      'nombre'              => new sfValidatorString(array('max_length' => 15)),
      'pass_md5'            => new sfValidatorString(array('max_length' => 50)),
      'email'               => new sfValidatorString(array('max_length' => 50)),
      'mostrar_correo'      => new sfValidatorInteger(),
      'codigo_verificacion' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'privilegios'         => new sfValidatorInteger(),
      'ciudad'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'pais'                => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'permite_intercambio' => new sfValidatorInteger(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorAnd(array(
        new sfValidatorPropelUnique(array('model' => 'SfAnimedbUsuario', 'column' => array('nombre'))),
        new sfValidatorPropelUnique(array('model' => 'SfAnimedbUsuario', 'column' => array('email'))),
      ))
    );

    $this->widgetSchema->setNameFormat('sf_animedb_usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SfAnimedbUsuario';
  }


}
